#include <stdio.h>
#include <unistd.h>

int main()
{
    printf("-----begin----\n");
    pid_t ret =fork();
    if(ret<0){
        perror("fork");
        return  0;
    }else if(ret>0){
        while (1){
            printf("I am father abcdef,pid=%d,pid=%d,ppid=%d\n",getpid(),getppid());
            sleep(2);
        }
    }else{
        while(1){
            printf("i am child 123456,pid=%d,ppid=%d\n",getpid(),getppid());
            sleep(1);
        }
    }
    return 0;
}